In this paper a numerical procedure is presented based on the method of least
squares (MLS) to synthesize a Stepline transformer to match two complex impedances over a
frequency bandwith for a specified line length. First, the input impedance of a Stepline
terminated in a load impedance is obtained using the transmission matrices of the line
sections and junction discontinuity impedances. Then, an error function is constructed as the
sum of the magnitude squared of the difference between the input impedance of the Stepline
and the generator impedance over discrete frequencies in the desired bandwidth. The error
function is then minimized with respect to the Stepline characteristic impedances and also
separately with respect to the Stepline length. This numerical procedure serves as an effective
tool for the design of transformers of complex impedances with specified lengths and
frequency bandwidths and its implementation reveals uncommon and interesting transformer
shapes which best realize matching conditions in the least square sense.